﻿/**
 * Enemy.cs - Enemy which kills the user if touched
 * 
 * Part of BoulderDAM - A BoulderDash clone using C# and SDL
 * Nacho Cabanes & students of DAM IES San Vicente, 2014
 * 
 * Revisions
 * #     Date         Creator, changes
 * ----  -----------  -------------------------------------------------------
 * 0.01  02-apr-2014  Nacho Cabanes: Only constructor
 * 0.02  03-apr-2014  Daniel Segura: Basic movement
 * 0.03  03-apr-2014  Nacho Cabanes: Rebounding on both sides
 */

namespace Boulder
{
    class Enemy : Sprite
    {
        public Enemy()
        {
            MoveTo(100, 200);
            LoadSequence(new string[] { "data/enemy1a.png", "data/enemy1b.png", "data/enemy1c.png" });
            xSpeed = 4;
        }

        public override void Animate()
        {
            x += xSpeed;
            if ((x > 900) || (x < 10))
                xSpeed = -xSpeed;
            NextFrame();
        }
    }
}
